home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8728 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  986 b 

  1. Path: news.bridge.net!news
  2. From: David Byrden <100101.2547@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: inline feature or bug ?
  5. Date: 26 Feb 1996 09:21:03 GMT
  6. Organization: self-employed
  7. Message-ID: <4gru1v$k3j@news.bridge.net>
  8. References: <1996Feb25.221651.114799@kuhub.cc.ukans.edu>
  9. NNTP-Posting-Host: ppp-mia1-45.bridge.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
  14.  
  15.  
  16.  
  17. >>  I declare my functions as inline. I have a .cc file in which I 
  18. >> implement the functions. I include inline at the function definitions 
  19. >> and g++ cannot link the stuff
  20.  
  21.  
  22.   Anh;
  23.  
  24.  
  25.   Think very hard about what the compiler has to do when you call an 
  26. inline function (answer at bottom)
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.   Answer; it has to expand all the function code at the point of the 
  63. call. So put your inline function definitions in the header file.
  64.  
  65.                                     David
  66.  
  67.  
  68.  
  69.  
  70.  
  71.